(self.AMP=self.AMP||[]).push({m:0,v:"2110011758000",n:"amp-carousel",ev:"0.2",l:false,f:function(AMP,_){"use strict";var h,aa="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b};function ba(a){for(var b=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global],c=0;cg,y=g>k,x=0a||a>this.j.length-1||isNaN(a)||a===this.A||this.ea||this.wa&&(3===this.L||2===this.L)||(this.S=!1,this.F=a,this.L=c,Ja(this,this.j[a],{smoothScroll:d}))};h.updateAdvanceCount=function(a){this.ga=a};h.updateAlignment=function(a){this.G="start"===a?"start":"center";this.updateUi()};h.updateAutoAdvance=function(a){this.D.updateAutoAdvance(a)};h.updateAutoAdvanceCount=function(a){this.D.updateAutoAdvanceCount(a)};h.updateAutoAdvanceInterval=function(a){this.D.updateAutoAdvanceInterval(a)};h.updateAutoAdvanceLoops=function(a){this.Ba=a;this.updateUi()};h.updateForwards=function(a){this.M=a;this.updateUi()};h.updateHideScrollbar=function(a){this.Da=a;this.updateUi()};h.updateHorizontal=function(a){this.H=a?0:1;this.updateUi()};h.updateLoop=function(a){this.Ga=a;this.updateUi()};h.updateMixedLength=function(a){this.T=a;this.la.updateMixedLength(a);this.updateUi()};h.updateSlides=function(a){var b=a.length;if(b)this.j=a,this.A=this.isLooping()?u(this.A,b):Math.min(Math.max(this.A,0),b-1)||0,this.la.updateSlides(a),this.updateUi();else{var c=this.W.tagName.toUpperCase();(H.dev||(H.dev=wa())).warn(c,"No slides were found.")}};h.updateSnap=function(a){this.Ka=a;this.updateUi()};h.updateSnapBy=function(a){this.Ja=Math.max(1,a);this.updateUi()};h.updateUserScrollable=function(a){this.Ma=a;this.updateUi()};h.updateUi=function(){var a=this;this.O||this.sa||(this.O=!0,this.N((function(){a.O=!1;a.h.setAttribute("mixed-length",a.T);a.h.setAttribute("user-scrollable",a.Ma);a.h.setAttribute("hide-scrollbar",a.Da);a.h.setAttribute("horizontal",0===a.H);a.h.setAttribute("loop",a.isLooping());a.h.setAttribute("snap",a.Ka);ka(a.h,{"--visible-count":a.C});a.j.length&&(a.D.updateMaxAdvances(a.Ba*a.j.length-1),Ka(a),La(a),Ma(a),M(a,!0))})))};h.updateVisibleCount=function(a){this.C=Math.max(1,a);this.la.updateVisibleCount(a);this.updateUi()};function Na(a,b,c){a.A=b;a.Z=c;a.W.dispatchEvent(I(a.P,"amp-carousel:offsetchange",t({index:b,total:a.j.length,offset:a.M?-c:c,slides:a.j}),{bubbles:!0}))}h.notifyScrollStart=function(){this.W.dispatchEvent(I(this.P,"amp-carousel:scrollstart",null))};h.pa=function(){var a=this;this.ea=!0;this.L=3;this.F=null;this.S=!1;xa((function(){a.ea=!1;a.Ca()}))};h.oa=function(){this.S?this.S=!1:(this.wa=!0,Oa(this),this.notifyScrollStart(),this.Ca())};function N(a,b,c,d){var e=a.H,f=c*d*(a.M?1:-1);a=0==e?f:0;e=0==e?0:f;z(b,"transform","translate("+a+"px, "+e+"px)");ka(b,{"--content-transform":"translate("+a+"px, "+e+"px)"});b._revolutions=c}function Pa(a,b){a.j.forEach((function(c){N(a,c,0,b)}))}function O(a){return a.j.map((function(b){return A(a.H,b).length}))}h.isAtEnd=function(){if(this.isLooping())var a=!1;else{a=this.h;var b=a.getBoundingClientRect().width*(this.M?1:-1);b=a.scrollLeft+(this.M?Math.ceil(b):Math.floor(b));a=a.scrollWidth;a=this.M?b>=a:b<=-a}return a};h.isAtStart=function(){if(this.isLooping())var a=!1;else a=this.h.scrollLeft,a=this.M?0>=a:0<=a;return a};function Qa(a){for(var b=[],c=0;ce.length-1||me.length-1||m>g}))}function Oa(a){var b=a.G,c=a.Aa,d=a.H,e=a.A,f=a.h,g=a.j,k=L(O(a)),m=!!c.length,l=m?c:g,n=ma(d,b,f,l,m?e+g.length:e);void 0!==n&&(c=n%g.length,b=la(d,b,f,l[n]),Na(a,c,b),c!==e&&a.N((function(){Ra(a,k)})))}function M(a,b){var c=void 0===b?!1:b,d=a.L;if(!a.ea&&(a.L=void 0,a.wa=!1,a.N((function(){a.W.dispatchEvent(I(a.P,"amp-carousel:scrollpositionchange",null))})),a.da!==a.A||null!==a.F||c)){null!==a.F&&(a.A=a.F,a.F=null,a.Z=0);var e=L(O(a));a.N((function(){var f=a.A;a.da!==f&&(a.da=f,a.W.dispatchEvent(I(a.P,"amp-carousel:indexchange",t({index:f,total:a.j.length,actionSource:d,slides:a.j}),{bubbles:!0})));Na(a,a.A,a.Z);Pa(a,e);Ma(a);Ra(a,e);Sa(a)}))}}function Sa(a){var b=a.H,c=a.Z,d=a.h,e=a.j[a.A],f=la(b,a.G,d,e)-c;c=A(b,e).length;var g=f*c;g&&(a.S=!0,Ga(d,(function(){var k=(0==b?d.scrollLeft:d.scrollTop)+g;0==b?d.scrollLeft=k:d.scrollTop=k})))}function Ja(a,b,c){(c.smoothScroll?function(d,e){return e()}:Ga)(a.h,(function(){var d=a.H,e=a.h,f="start"==a.G,g=A(d,b).length,k=f?A(d,b).start:B(d,b);f=f?A(d,e).start:B(d,e);g=(0==d?e.scrollLeft:e.scrollTop)+(k-f-0*g);0==d?e.scrollLeft=g:e.scrollTop=g}))}function Ta(a,b,c,d){for(var e=a.A,f=a.da,g=a.j,k=g[e]._revolutions||0,m=d?1:-1,l=1;l<=c;l++){var n=u(e+l*m,g.length);if(n===f&&e!==f)break;N(a,g[n],n>e!==d?k+m:k,b)}}function Ra(a,b){if(a.isLooping()){var c=a.j,d=a.C,e="start"===a.G?d-1:0,f=(c.length-1+e)/2;Ta(a,b,Math.round((c.length-1-e)/2),!1);Ta(a,b,Math.round(f),!0)}}function Ia(a,b){var c=a.C;return b>=a.j.length-("start"===a.G?c:c/2)}function P(a,b){a=a.__AMP_TOP||(a.__AMP_TOP=a);return Q(a,b)}function Ua(a,b){var c=R(a);c=S(c);return Q(c,b)}function Va(a){a=R(a);a=S(a);return Wa(a,"action")?Q(a,"action"):null}function R(a){return a.nodeType?P((a.ownerDocument||a).defaultView,"ampdoc").getAmpDoc(a):a}function S(a){a=R(a);return a.isSingleDoc()?a.win:a}function Q(a,b){Wa(a,b);a=Xa(a)[b];a.obj||(a.obj=new a.ctor(a.context),a.context=null,a.resolve&&a.resolve(a.obj));return a.obj}function Ya(a){var b=Xa(a)["amp-analytics-instrumentation"];if(b){if(b.promise)return b.promise;Q(a,"amp-analytics-instrumentation");return b.promise=Promise.resolve(b.obj)}return null}function Xa(a){var b=a.__AMP_SERVICES;b||(b=a.__AMP_SERVICES={});return b}function Wa(a,b){a=a.__AMP_SERVICES&&a.__AMP_SERVICES[b];return!(!a||!a.ctor)}function Za(){var a=new ha,b=a.promise,c=a.reject;a=a.resolve;b.catch((function(){}));return{obj:null,promise:b,resolve:a,reject:c,context:null,ctor:null}}function $a(a){var b=Ya(S(a));if(b)return b;var c=R(a);return c.whenExtensionsKnown().then((function(){var d=c.getExtensionVersion("amp-analytics");return d?P(c.win,"extensions").waitForExtension("amp-analytics",d):null})).then((function(d){if(d){var e=S(a);var f=Ya(e);f?e=f:(e=Xa(e),e["amp-analytics-instrumentation"]=Za(),e=e["amp-analytics-instrumentation"].promise)}else e=null;return e}))}function ab(a){var b=a.ampElement,c=a.intersectionElement,d=void 0===a.intersectionThreshold?.01:a.intersectionThreshold,e=void 0===a.nearbyMarginInPercent?100:a.nearbyMarginInPercent,f=void 0===a.viewportIntersectionThreshold?d:a.viewportIntersectionThreshold,g=void 0===a.viewportIntersectionCallback?function(){}:a.viewportIntersectionCallback;this.R=b;this.ua=Ua(b.element,"owners");this.qa=c;this.Fa=d;this.Ia=e;this.Qa=f;this.ya=g;this.ba=!1;this.B=[];this.$=this.Y=this.aa=null;this.X=!1}h=ab.prototype;h.setQueueChanges=function(a){this.ba=a};function T(a,b,c){c?a.ua.scheduleLayout(a.R.element,b):a.ua.scheduleUnlayout(a.R.element,b)}function cb(a){if(!(a.aa&&a.Y&&a.$)){var b=a.R.win;a.aa=new b.IntersectionObserver((function(c){return db(a,c)}),{root:a.qa,rootMargin:a.Ia+"%",threshold:a.Fa});a.Y=new b.IntersectionObserver((function(c){return eb(a,c)}),{root:a.qa,rootMargin:a.Ia+10+"%",threshold:a.Fa});a.$=new b.IntersectionObserver((function(c){return fb(a,c)}),{root:a.qa,rootMargin:"0%",threshold:a.Qa})}}function db(a,b){b.filter((function(c){return c.isIntersecting})).forEach((function(c){c.target.__AMP_CAROUSEL_NEAR_VIEWPORT=0}));a.ba||gb(a)}function eb(a,b){b.filter((function(c){return!c.isIntersecting})).forEach((function(c){c.target.__AMP_CAROUSEL_NEAR_VIEWPORT=1}));a.ba||hb(a)}function fb(a,b){b.forEach((function(c){c.target.__AMP_CAROUSEL_IN_VIEWPORT=c.isIntersecting?0:1}));a.ba||ib(a)}h.flushChanges=function(){gb(this);hb(this);ib(this)};function gb(a){for(var b=0;b'];function W(a){var b=AMP.BaseElement.call(this,a)||this;b.ra=P(b.win,"platform").isIos();b.o=null;b.h=null;b.j=[];b.A=null;b.fa="carousel";b.ka=!1;b.J=null;b.K=null;b.na=!1;b.za=null;b.I=null;b.xa=!1;b.Pa=Ua(a,"viewer").isEmbedded();return b}var X=AMP.BaseElement;W.prototype=aa(X.prototype);W.prototype.constructor=W;if(ea)ea(W,X);else for(var Y in X)if("prototype"!=Y)if(Object.defineProperties){var nb=Object.getOwnPropertyDescriptor(X,Y);nb&&Object.defineProperty(W,Y,nb)}else W[Y]=X[Y];W.Ra=X.prototype;W.prerenderAllowed=function(){return!0};function ob(a){a.registerAction("goToSlide",(function(b){var c=b.args,d=b.trust,e=Number(c.index||0),f=!isNaN(e);c=c.index;var g=a.element;H.user||(H.user=wa());H.user.assert(f,"Unexpected slide index for goToSlide action: %s. %s",c,g,void 0,void 0,void 0,void 0,void 0,void 0,void 0);a.o.goToSlide(e,{actionSource:2<=d?0:1})}),1);a.registerAction("toggleAutoplay",(function(b){b=b.args;pb(a,b?b.toggleOn:void 0)}),1)}h=W.prototype;h.isLayoutSupported=function(a){return"fixed"==a||"fixed-height"==a||"responsive"==a||"fill"==a||"flex-item"==a||"fluid"==a||"intrinsic"==a};h.buildCallback=function(){var a=this;this.za=Va(this.element);var b=this.element,c=this.win,d=ta(this.element);b.appendChild(jb(this.element)(mb));this.h=this.element.querySelector(".i-amphtml-carousel-scroll");this.K=this.element.querySelector(".amp-carousel-button-prev");this.J=this.element.querySelector(".amp-carousel-button-next");this.o=new Ha({win:c,element:b,scrollContainer:this.h,initialIndex:Number(this.element.getAttribute("slide")||"0"),runMutate:function(f){return a.mutateElement(f)}});qb(this,d);ob(this);this.element.addEventListener("amp-carousel:indexchange",(function(f){a.ta(f)}));this.element.addEventListener("amp-carousel:scrollstart",(function(){a.I.setQueueChanges(a.ra)}));this.element.addEventListener("amp-carousel:scrollpositionchange",(function(){a.I.flushChanges();a.I.setQueueChanges(!1);Z(a)}));this.K.addEventListener("click",(function(){return a.interactionPrev()}));this.J.addEventListener("click",(function(){return a.interactionNext()}));rb(this);var e=Ua(b,"owners");this.I=new ab({ampElement:this,intersectionElement:this.h,nearbyMarginInPercent:this.ra?200:100,viewportIntersectionCallback:function(f,g){g?e.scheduleResume(a.element,f):e.schedulePause(a.element,f)}});this.I.setQueueChanges(this.ra);this.I.updateChildren(this.j);this.o.updateSlides(this.j);this.o.goToSlide(Number(this.element.getAttribute("slide")||"0"));if(this.element.hasAttribute("controls"))this.xa=!0;else P(this.win,"input").onMouseDetected((function(f){f&&(a.xa=!0,Z(a))}),!0);return this.mutateElement((function(){}))};h.isRelayoutNeeded=function(){return!0};h.layoutCallback=function(){if(ra(this.element))return fa();this.I.wasLaidOut();this.o.updateUi();return fa()};h.unlayoutCallback=function(){this.I.wasUnlaidOut();return!0};h.pauseCallback=function(){this.o.pauseLayout()};h.resumeCallback=function(){this.o.resumeLayout()};h.mutatedAttributesCallback=function(a){void 0!==a.slide&&this.o.goToSlide(Number(a.slide))};h.goToSlide=function(a){this.o.goToSlide(a,{smoothScroll:!1})};h.interactionNext=function(){"carousel"==this.fa?sb(this,!0):this.o.next(0)};h.interactionPrev=function(){"carousel"==this.fa?sb(this,!1):this.o.prev(0)};function sb(a,b){var c=a.h;a=(a.win.getComputedStyle(c)||ja).direction;c.scrollLeft+=c.offsetWidth*(b?1:-1)*("rtl"==a?-1:1)}function qb(a,b){var c=a.element.getAttribute("dir")||(a.win.getComputedStyle(a.element)||ja).direction,d=a.element.hasAttribute("loop"),e=a.element.getAttribute("autoplay"),f=a.element.getAttribute("delay"),g=a.element.getAttribute("type"),k=null!=e,m=e?Number(e):Number.POSITIVE_INFINITY,l=Math.max(Number(f)||5e3,1e3);a.o.updateForwards("rtl"!=c);a.o.updateLoop(d||k);a.o.updateAutoAdvanceLoops(m);a.o.updateAutoAdvanceInterval(l);a.mutateElement((function(){a.K.setAttribute("dir",c);a.J.setAttribute("dir",c)}));pb(a,k);tb(a,g,b);Z(a)}function ub(a,b){var c=String(b+1),d=String(a.j.length);return" "+(a.element.getAttribute("data-button-count-format")||"(%s of %s)").replace("%s",c).replace("%s",d)}function Z(a){var b=a.o.getCurrentIndex(),c=a.na&&!a.xa,d=c||a.o.isAtStart(),e=c||a.o.isAtEnd();a.K.classList.toggle("amp-disabled",d);a.K.setAttribute("aria-disabled",d);var f=a.K;var g=0<=b-1?b-1:a.element.hasAttribute("loop")?a.j.length-1:null;g=null==g?0:g;g=(a.element.getAttribute("data-prev-button-aria-label")||"Previous item in carousel")+ub(a,g);f.title=g;a.K.tabIndex=d?-1:0;a.J.classList.toggle("amp-disabled",e);a.J.setAttribute("aria-disabled",e);f=a.J;b=b+1c/d||0>c&&-.5>c/d:0.i-amphtml-carousel-slotted,.i-amphtml-carousel-scroll[horizontal=true][mixed-length=false]>.i-amphtml-carousel-spacer{width:calc(100%/var(--visible-count))!important;min-width:auto!important;max-width:none!important}.i-amphtml-carousel-scroll[horizontal=false][mixed-length=false]>.i-amphtml-carousel-slotted,.i-amphtml-carousel-scroll[horizontal=false][mixed-length=false]>.i-amphtml-carousel-spacer{height:calc(100%/var(--visible-count))!important;min-height:auto!important;max-height:none!important}.i-amphtml-carousel-scroll[horizontal=true][snap=true][mixed-length=true]>.i-amphtml-carousel-slotted,.i-amphtml-carousel-scroll[horizontal=true][snap=true][mixed-length=true]>.i-amphtml-carousel-spacer{max-width:100%!important}.i-amphtml-carousel-scroll[horizontal=false][snap=true][mixed-length=true]>.i-amphtml-carousel-slotted,.i-amphtml-carousel-scroll[horizontal=false][snap=true][mixed-length=true]>.i-amphtml-carousel-spacer{max-height:100%!important}.i-amphtml-carousel-scroll>.i-amphtml-carousel-slotted{will-change:transform}amp-carousel .i-amphtml-carousel-scroll[horizontal=true]{padding-bottom:0!important}amp-carousel:not([type=slides]) .i-amphtml-carousel-scroll{display:block!important;white-space:nowrap!important}amp-carousel:not([type=slides]) .i-amphtml-carousel-content{position:static}.amp-scrollable-carousel-slide{display:inline-block!important;margin-left:8px;margin-inline-start:8px;margin-inline-end:0}.amp-scrollable-carousel-slide.i-amphtml-layout-responsive{width:100%}.amp-scrollable-carousel-slide:first-child{margin-left:0px;margin-inline-start:0;margin-inline-end:0}.i-amphtml-carousel-arrows{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;pointer-events:none}.amp-carousel-button[dir=rtl]{transform:scaleX(-1)}.amp-carousel-button{position:relative;box-sizing:border-box;height:34px;width:34px;margin:16px;border-style:none;border-radius:2px;background-color:rgba(0,0,0,.5);background-position:50% 50%;background-repeat:no-repeat;z-index:10;pointer-events:all}.amp-carousel-button:focus{border:1px solid #000;outline:1px solid #fff}.amp-carousel-button.amp-disabled{animation:none;pointer-events:none;clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;white-space:nowrap;width:1px}.amp-carousel-button-prev{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%23fff'%3E%3Cpath d='M15 8.25H5.87l4.19-4.19L9 3 3 9l6 6 1.06-1.06-4.19-4.19H15v-1.5z'/%3E%3C/svg%3E\");background-size:18px 18px}.amp-carousel-button-next{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%23fff'%3E%3Cpath d='M9 3 7.94 4.06l4.19 4.19H3v1.5h9.13l-4.19 4.19L9 15l6-6z'/%3E%3C/svg%3E\");background-size:18px 18px}.i-amphtml-carousel-slide-item{position:relative!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-pack:center!important;justify-content:center!important;-ms-flex-align:center!important;align-items:center!important}.i-amphtml-carousel-slide-item>*{width:100%;height:100%;overflow:hidden!important}.amp-carousel-slide>.i-amphtml-replaced-content{-o-object-fit:contain;object-fit:contain}\n/*# sourceURL=/extensions/amp-carousel/0.2/amp-carousel.css*/")}});//# sourceMappingURL=amp-carousel-0.2.js.map